﻿<%@ Page Title="Nhóm khách hàng" Language="C#" MasterPageFile="~/App_MasterPages/Aquarius.Master"
    AutoEventWireup="true" CodeBehind="CustomerGroupManagement.aspx.cs" Inherits="PanasonicWarranty.UI.CustomerGroupManagement"  %>

<%@ Register Src="../UserControl/ucPaging.ascx" TagName="ucPaging" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CssContent" runat="server">

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ScriptContent" runat="server">
    <script type="text/javascript">
        $(document).ready(function () {
            RegisterDialog();
            ComboBox("ddlCateCode");
        });
    </script>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    <div class="row-fluid">
        <div class="span12">
            <div class="head">
                <div class="isw-grid"></div>
                <h1>Danh mục nhóm khách hàng</h1>
                <ul class="buttons">
                    <li>
                        <asp:LinkButton CssClass="isw-plus" ID="lbtnAddNew" runat="server" 
                            onclick="lbtnAddNew_Click" />
                    </li>
                </ul>
                <div class="clear">
                </div>
            </div>
            <div class="block-fluid table-sorting">
                <div class="dataTables_wrapper" id="tSortable_wrapper">
                    <asp:GridView ID="grvData" CssClass="table2 dataTable" runat="server" 
                        AutoGenerateColumns="false" Width="100%"
                        ShowHeaderWhenEmpty="true" onrowcommand="grvData_RowCommand">
                        <Columns>
                            <asp:TemplateField HeaderText="STT" ItemStyle-CssClass="STT">
                                <ItemTemplate>
                                    <%#(Container.DataItemIndex + 1)%>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField HeaderText="Mã nhóm" DataField="CustomerGroupCode" />
                            <asp:BoundField HeaderText="Tên nhóm" DataField="CustomerGroupName" />
                            <asp:BoundField HeaderText="Diễn giải" DataField="Description" />
                            <asp:TemplateField HeaderText="Chức năng" ItemStyle-CssClass="Function">
                                <ItemTemplate>
                                    <asp:LinkButton ID="lbtnEdit" Text="Sửa" runat="server"
                                        CommandName="Editing" CommandArgument='<%#Eval("CustomerGroupID")%>' />
                                    &nbsp; &nbsp;
                                    <asp:LinkButton ID="lbtnDelete" Text="Xóa" runat="server"
                                        CommandName="Deleting" CommandArgument='<%#Eval("CustomerGroupID")%>' OnClientClick="return confirm('Bạn có chắc chắn muốn xóa không?');" />
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
                </div>
                <div class="clear">
                </div>
            </div>
        </div>
    </div>
    <div class="dr">
        <span></span>
    </div>
    <div class="dialog" id="dialog1" title="Thông tin khách hàng" style="display: none;">
        <asp:Panel ID="pnlDialogBlock" runat="server" CssClass="block">
            <asp:HiddenField ID="hdfID" Value="" runat="server" />
            <table width="100%" cellpadding="2" cellspacing="2" >
                <tr>
                    <td>Mã nhóm</td>
                    <td><asp:TextBox ID="txtCode" runat="server" /></td>
                </tr>
                <tr>
                    <td>Tên nhóm</td>
                    <td><asp:TextBox ID="txtName" runat="server" /></td>
                </tr>
                <tr>
                    <td>Diễn giải</td>
                    <td>
                        <asp:TextBox ID="txtDescription" runat="server" TextMode="MultiLine"/>
                    </td>
                </tr>
                <tr>
                    <td>Số thứ tự</td>
                    <td><asp:TextBox ID="txtOrder" runat="server" onkeypress="retun ValidateKeypress(/\d+/,event);"/></td>
                </tr>
            </table>
            <div style="text-align:center; width:100%; color:Red"><asp:Label ID="lbError" runat="server" /></div>
            <div class="dr"><span></span></div>
            <div style="text-align: right">
                <asp:Button ID="btnSave" CssClass="btn" runat="server" Text="Lưu" 
                    onclick="btnSave_Click" />
                <input type="button" class="btn" value="Đóng" onclick="$('#dialog1').dialog('close'); return false;" />
            </div>
        </asp:Panel>
    </div>
</asp:Content>
